using System;
using AgileBoard.Core;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;

namespace AgileBoard.Infrastructure.NHibernateMaps
{
    public class ProjectMap : IAutoMappingOverride<Project>
    {
        public void Override(AutoMapping<Project> mapping)
        {
            mapping.HasMany(x => x.Iterations)
                .Inverse()
                .Cascade.All();
            
            mapping.HasMany(x => x.DefaultStates)
                .Inverse()
                .Cascade.All();
        }
    }
}